using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace WorkTool
{
    public partial class AskQuestion : Form
    {
        public string Answer = "";


        public AskQuestion(string Question)
        {
            InitializeComponent();
            label1.Text = Question ?? "";
        }
		public AskQuestion(string Question, bool isPassword)
		{
			InitializeComponent();
			label1.Text = Question ?? "";
			if (isPassword) 
				textBox1.PasswordChar = '*';
		}
		public AskQuestion(string Question, string DefaultAnswer)
		{
			InitializeComponent();
			label1.Text = Question ?? "";
			textBox1.Text = DefaultAnswer;
			textBox1.SelectAll();
			textBox1.ScrollToCaret();
		}

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Answer = null;
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Hide();
            return;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Answer = textBox1.Text;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Hide();
            return;
        }
    }
}